﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;

public class UIAnimScale : MonoBehaviour
{
    [SerializeField]
    Vector3 e_ScaleStart = Vector3.zero;
    [SerializeField]
    float e_DurMid = 0.2f;
    [SerializeField]
    Vector3 e_ScaleMid = new Vector3(1.3f, 1.3f, 1.3f);
    [SerializeField]
    float e_DurEnd = 0.2f;
    [SerializeField]
    Vector3 e_ScaleEnd = Vector3.one;

    private void OnEnable()
    {
        transform.localScale = e_ScaleStart;
        Sequence sequence = DOTween.Sequence();
        sequence.Append(transform.DOScale(e_ScaleMid, e_DurMid));
        sequence.Append(transform.DOScale(e_ScaleEnd, e_DurEnd));
    }

    private void OnDisable()
    {
        transform.localScale = e_ScaleStart;
    }
}
